// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
export default function(){
    const table = {
        key: 'ProductPlanId',
        footer: "Foots",
        cnName: '生产计划',
        name: 'ProductPlan',
        newTabEdit: false,
        url: "/ProductPlan/",
        sortName: "ProductPlanrId"
    };
    const tableName = table.name;
    const tableCNName = table.cnName;
    const newTabEdit = false;
    const key = table.key;
    const editFormFields = {"BillNo":"","BillDate":"","BillTypeId":"","DepartmentId":[],"CustomerId":"","IsCreateTask":""};
    const editFormOptions = [[{"title":"单据编号","field":"BillNo","disabled":true,"type":"text"},
                               {"title":"单据日期","required":true,"field":"BillDate","type":"date"},
                               {"dataKey":"生产计划类型","data":[],"title":"单据类型","required":true,"field":"BillTypeId","type":"select"}],
                              [{"dataKey":"部门级联","data":[],"title":"部门","required":true,"field":"DepartmentId","type":"cascader"},
                               {"dataKey":"客户档案","data":[],"title":"客户","field":"CustomerId","type":"select"},
                               {"dataKey":"生成生产任务状态","data":[],"title":"生产任务","field":"IsCreateTask","disabled":true,"type":"select"}]];
    const searchFormFields = {"BillNo":"","BillDate":""};
    const searchFormOptions = [[{"title":"单据编号","field":"BillNo"},{"title":"单据日期","field":"BillDate"}]];
    const columns = [{field:'ProductPlanId',title:'生产订单标识',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'BillNo',title:'单据编号',type:'string',link:true,width:120,readonly:true,align:'left'},
                       {field:'BillDate',title:'单据日期',type:'date',width:110,require:true,align:'left'},
                       {field:'BillTypeId',title:'单据类型',type:'int',bind:{ key:'生产计划类型',data:[]},width:110,require:true,align:'left'},
                       {field:'DepartmentId',title:'部门',type:'guid',bind:{ key:'部门级联',data:[]},width:110,require:true,align:'left'},
                       {field:'CustomerId',title:'客户',type:'int',bind:{ key:'客户档案',data:[]},width:110,align:'left'},
                       {field:'CreateID',title:'创建人标识',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人名称',type:'string',width:100,align:'left'},
                       {field:'CreateDate',title:'创建日期',type:'datetime',width:110,align:'left'},
                       {field:'ModifyID',title:'修改人标识',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人名称',type:'string',width:100,align:'left'},
                       {field:'ModifyDate',title:'修改日期',type:'datetime',width:110,align:'left'},
                       {field:'AuditDate',title:'审核日期',type:'datetime',width:110,align:'left'},
                       {field:'AuditStatus',title:'审核状态',type:'int',bind:{ key:'audit',data:[]},width:110,align:'left'},
                       {field:'AuditId',title:'审核人标识',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Auditor',title:'审核人',type:'string',width:120,align:'left'},
                       {field:'IsCreateTask',title:'生产任务',type:'int',bind:{ key:'生成生产任务状态',data:[]},width:80,readonly:true,align:'left'}];
    const detail =  {
                    cnName: '生产计划明细',
                    table: 'ProductPlanDetail',
                    columns: [{field:'ProductPlanDetailId',title:'生产订单明细标识',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ProductPlanId',title:'生产订单标识',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'MaterialId',title:'产品标识',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'IsCreateTask',title:'生产任务',type:'int',bind:{ key:'生成生产任务状态',data:[]},width:80,hidden:true,edit:{type:'select'},align:'left'},
                       {field:'MaterialNo',title:'产品编码',type:'string',width:110,readonly:true,edit:{type:'text'},require:true,align:'left'},
                       {field:'MaterialName',title:'产品名称',type:'string',width:110,readonly:true,edit:{type:'text'},align:'left'},
                       {field:'Spec',title:'规格',type:'string',width:110,readonly:true,edit:{type:'text'},align:'left'},
                       {field:'MaterialTypeId',title:'产品类型',type:'int',bind:{ key:'物料属性',data:[]},width:110,readonly:true,edit:{type:'select'},require:true,align:'left'},
                       {field:'UnitId',title:'计量单位',type:'int',bind:{ key:'计量单位',data:[]},width:110,readonly:true,edit:{type:'select'},require:true,align:'left'},
                       {field:'BomId',title:'Bom标识',type:'int',width:110,hidden:true,readonly:true,align:'left'},
                       {field:'BomNo',title:'Bom编码',type:'string',width:120,edit:{type:'text'},align:'left'},
                       {field:'TechnologicalProcessId',title:'生产工艺标识',type:'int',width:110,hidden:true,readonly:true,align:'left'},
                       {field:'TechnologicalProcessNo',title:'工艺编码',type:'string',width:120,edit:{type:'text'},align:'left'},
                       {field:'IsLoted',title:'启用批次',type:'int',bind:{ key:'是否',data:[]},width:80,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'LotText',title:'批号',type:'string',bind:{ key:'批号主档',data:[]},width:220,edit:{type:'select'},align:'left'},
                       {field:'LotMasterDetailId',title:'批号标识',type:'int',width:80,hidden:true,align:'left'},
                       {field:'DeliveryDate',title:'预计交货日期',type:'datetime',width:150,edit:{type:'date'},require:true,align:'left'},
                       {field:'PlanQty',title:'计划数量',type:'decimal',width:110,edit:{type:'decimal'},require:true,align:'left'},
                       {field:'AllPrice',title:'单价',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'AllAmount',title:'金额',type:'decimal',width:110,edit:{type:'decimal'},align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:180,edit:{type:'text'},align:'left'}],
                    sortName: 'ProductPlanDetailId',
                    key: 'ProductPlanDetailId'
                                            };
    const details = [];

    return {
        table,
        key,
        tableName,
        tableCNName,
        newTabEdit,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
        details
    };
}